package com.zy.openchat.core.model.group;

import android.os.Parcel;
import android.os.Parcelable;

@Deprecated
public class BasicGroupInfo implements Parcelable {
    //Group identifier
    public long id;
    //Number of members in the group
    public int member_count;
    //True, if the group is active
    public boolean is_active;
    //Identifier of the supergroup to which this group was upgraded; 0 if none
    public long upgraded_to_supergroup_id;
    //Status of the current user in the group
    public Group_ChatMemberStatus status;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.id);
        dest.writeInt(this.member_count);
        dest.writeByte(this.is_active ? (byte) 1 : (byte) 0);
        dest.writeLong(this.upgraded_to_supergroup_id);
        dest.writeParcelable(this.status, flags);
    }

    public BasicGroupInfo() {
    }

    protected BasicGroupInfo(Parcel in) {
        this.id = in.readLong();
        this.member_count = in.readInt();
        this.is_active = in.readByte() != 0;
        this.upgraded_to_supergroup_id = in.readLong();
        this.status = in.readParcelable(Group_ChatMemberStatus.class.getClassLoader());
    }

    public static final Creator<BasicGroupInfo> CREATOR = new Creator<BasicGroupInfo>() {
        @Override
        public BasicGroupInfo createFromParcel(Parcel source) {
            return new BasicGroupInfo(source);
        }

        @Override
        public BasicGroupInfo[] newArray(int size) {
            return new BasicGroupInfo[size];
        }
    };
}
